<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'opportunityContact.label', default: 'OpportunityContact')}"/>
    <title>编辑联系人信息：${this.opportunityContact?.contact?.fullName}</title>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li><g:link controller="opportunity" action="show"
                                id="${this.opportunityContact?.opportunity?.id}">订单详情</g:link></li>
                    <li class="active">编辑联系人</li>
                </ol>
            </div>
            <h2 class="font-light m-b-xs">
                编辑联系人信息
            </h2>

        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <div class="hpanel hyellow">
            <div class="panel-heading">
                <div class="panel-tools">
                </div>
                联系人信息
            </div>

            <div class="panel-body">
                <g:if test="${flash.message}">
                    <div class="message alert alert-info" role="status">${flash.message}
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                                aria-hidden="true">×</span></button>
                    </div>
                </g:if>
                <g:hasErrors bean="${this.opportunityContact}">
                    <ul class="errors" role="alert">
                        <g:eachError bean="${this.opportunityContact}" var="error">
                            <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                                    error="${error}"/></li>
                        </g:eachError>
                    </ul>
                </g:hasErrors>
                <g:form id="${this.opportunityContact?.id}" action="update" method="PUT" class="form-horizontal">
                    <div class="form-group">
                        <label class="col-md-2 control-label">订单编号</label>

                        <div class="col-md-3">
                            <g:textField class="hide" name="opportunity.id" id="opportunity" readOnly="true"
                                         value="${this.opportunityContact?.opportunity?.id}"></g:textField>
                            <g:textField class="form-control" name="serialNumber" readOnly="true"
                                         value="${this.opportunityContact?.opportunity?.serialNumber}"></g:textField>
                        </div>
                        <label class="col-md-2 control-label">单位名称</label>

                        <div class="col-md-3">

                            <g:textField class="form-control" name="contact.companyName"
                                         value="${this.opportunityContact?.contact?.companyName}"></g:textField>
                        </div>

                    </div>

                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">联系人姓名</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" name="contact.fullName"
                                         value="${this.opportunityContact?.contact?.fullName}"></g:textField>
                        </div>
                        <label class="col-md-2 control-label">单位地址</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" name="contact.companyAddress"
                                         value="${this.opportunityContact?.contact?.companyAddress}"></g:textField>
                        </div>

                    </div>

                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                      <label class="col-md-2 control-label">联系人电话</label>

                      <div class="col-md-3">
                          <g:textField class="form-control" name="contact.cellphone"
                                       value="${this.opportunityContact?.contact?.cellphone}"></g:textField>

                      </div>
                      <label class="col-md-2 control-label">家庭住址</label>

                      <div class="col-md-3">
                          <g:textField class="form-control" name="contact.residentialAddress"
                                       value="${this.opportunityContact?.contact?.residentialAddress}"></g:textField>

                      </div>

                      </div>



                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">联系人身份证号</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" name="contact.idNumber"
                                         value="${this.opportunityContact?.contact?.idNumber}"></g:textField>
                        </div>
                        <label class="col-md-2 control-label">现单位工作年限（年）</label>

                        <div class="col-md-3">
                            <g:textField class="form-control" name="contact.currentSeniority"
                                         value="${this.opportunityContact?.contact?.currentSeniority}"></g:textField>
                        </div>

                    </div>

                    <div class="hr-line-dashed"></div>
                  <div class="form-group">
                    <label class="col-md-2 control-label">联系人婚姻状况</label>

                    <div class="col-md-3">
                        <g:select class="form-control" name="contact.maritalStatus"
                                  value="${this.opportunityContact?.contact?.maritalStatus}"
                                  from="${["未婚", "已婚", "再婚", "离异", "丧偶"]}"/>
                    </div>
                    <label class="col-md-2 control-label">职位等级</label>

                    <div class="col-md-3">
                      <g:textField class="form-control" name="contact.jobLevel"
                                   value="${this.opportunityContact?.contact?.jobLevel}"></g:textField>

                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-md-2 control-label">学历</label>

                    <div class="col-md-3">
                        <g:select class="form-control" name="contact.certificate"
                                  value="${this.opportunityContact?.contact?.certificate?.id}" optionKey="id" optionValue="name"
                                  from="${com.next.Certificate.list()}"/>
                    </div>
                    <label class="col-md-2 control-label">平均月收入（元）</label>

                    <div class="col-md-3">
                      <g:textField class="form-control" name="contact.monthlyIncome"
                                   value="${this.opportunityContact?.contact?.monthlyIncome}"></g:textField>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-md-2 control-label">是否有房</label>
                    <div class="col-md-3 checkbox-inline">
                        <g:radioGroup class="checkbox-inline" name="contact.houseOwner" value="${this.opportunityContact?.contact.houseOwner}" labels="['启用','禁用']" values="[true,false]">
                            ${it.radio} ${it.label}
                        </g:radioGroup>
                    </div>


                  </div>
                  <div class="form-group">
                      <div class="col-md-3 col-md-offset-3">
                          <g:submitButton class="btn btn-info" name="create" value="保存"/>
                      </div>
                  </div>
                </g:form>
            </div>
        </div>
    </div>
</div>

</body>
</html>
